package com.baizhi.dao;

import com.baizhi.entity.Role;
import com.baizhi.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.security.core.userdetails.UserDetails;

import java.util.List;

/**
 * ClassName: UserDao
 * Description:
 * Date: 2022/11/03 PM 9:36
 * <p>
 * project: codes
 * package: com.baizhi.dao
 * email: 1085844536@qq.com
 * version:
 *
 * @author WangGuojian
 */
@Mapper
public interface UserDao {

    /**
     * 根据用户名获取用户对象
     *
     * @param username 用户名
     * @return 用户信息
     */
    User loadUserByUsername(String username);

    /**
     * 根据用户 id 查询用户角色信息
     *
     * @param uid 用户 id
     * @return 角色集合
     */
    List<Role> getRolesByUid(Integer uid);
}
